package tv.acgn.advertisement.search.callaction;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
import tv.acgn.advertisement.search.client.AdPublishClient;
import tv.acgn.advertisement.servicebase.exception.AbstractAdSysBusinessException;
import tv.acgn.advertisement.servicebase.vo.CommonResponse;

/**
 * @author : junG
 * @program : advertisement-ad-search-call-action
 * @description : 广告服务消费者调用路由类
 * 注意 所有的消费者调用路由类CallAction
 * 都只能用于模块内部远程调用其他服务提供者
 * 不允许直接暴露出外部可访问的接口
 * @date : 2019-06-16 18:31
 **/

@RestController
@Slf4j
public class AdPublishCallAction {

    private final AdPublishClient adPublishClient;

    @Autowired
    public AdPublishCallAction(AdPublishClient adPublishClient) {this.adPublishClient = adPublishClient;}

    public CommonResponse getAdPlan(String id) throws AbstractAdSysBusinessException {
        log.trace("远程调用 ad=publish模块 获取一个AdPlan id={}", id);
        return adPublishClient.getAdPlan(id);
    }

    /*public CommonResponse getAdPlanBatch(List<AdPlanRequest> ids)throws AbstractAdSysBusinessException{
        log.trace("远程调用 ad=publish模块 获取一个AdPlan ids={}",ids);
        return adPublishClient.getAdPlanBatch(ids);
    }*/
}
